<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-easyui/jquery.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/js/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/js/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/cyUtil.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/cyEasyUi.js"></script>
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/js/jquery-easyui/themes/default/easyui.css"
          type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/js/jquery-easyui/themes/icon.css"
          type="text/css"/>
</head>
<body>
${json.msg}
<span style="color:red;"><a href=${json.redirectPage}>点击跳转</a></span>
<button id="btn" onclick="closeTab(${json.fun});">点击关闭</button>
<span id="msg"></span>
</body>
</html>
<script>
    var wait = 10;
    setInterval(function () {
        wait--;
        document.getElementById("msg").innerHTML = wait;
        if (wait == 0) {
            if (${json.fun != null}) {
                $("#btn").click();
            } else {
                window.location.href = '${json.redirectPage}';
            }
        }
    }, 1000);

    function closeTab(title) {
        window.parent.window.closeTab(title);
    }
</script>